package com.twxm.breed.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsAutoIncrement;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsKey;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/*
溶氧监控
 */
@Data
@Table(name = "monitor")
public class Monitor {
    @IsKey
    @TableId
    @IsAutoIncrement
    private int id;

    @Column(name = "device_id",type = MySqlTypeConstant.VARCHAR)
    private DeviceInfo deviceInfo;

    @Column(comment = "溶氧值上限")
    private float upper;

    @Column(comment = "溶氧值下限")
    private float lower;

    @Column(comment = "监控开始时间",type = MySqlTypeConstant.DATETIME)
    private Date startTime;

    public Monitor(DeviceInfo deviceInfo, Float upper, Float lower, Date date) {
        this.deviceInfo = deviceInfo;
        this.upper = upper;
        this.lower = lower;
        this.startTime = date;
    }
}
